package org.xxpay.pay.channel.haitian;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.Assert;
import org.xxpay.common.unify.AbstractPaymentConfig;

public class HaitianConfig extends AbstractPaymentConfig {
    public static final String CHANNEL_NAME = "haitian";
    public static final String CHANMEL_NAME_HAITIAN_WXPAY = CHANNEL_NAME + "_wxpay";
    public static final String CHANMEL_NAME_HAITIAN_WXPAY_SCAN = CHANNEL_NAME + "_wxpay_scan";
    public static final String CHANMEL_NAME_HAITIAN_ALI_QR = CHANNEL_NAME + "_ali_qr";

    public static final String VIL_VERSION_VLAUE = "2";//版本号固定值

    public static final String REQ_PAY_2_3_Fixx = "/api/recharge/index";//支付下单后缀
    public static final String REQ_PAY_2_4_Fixx = "/api/recharge/scanpay";//支付下单后缀
    public static final String REQ_QUERY_Fixx = "/api/recharge/queryorder";//订单查询后缀
    public static final String REQ_TRANS_Fixx = "/api/withdrawal/create";//代付后缀
    public static final String RESPONSE_RESULT_OK = "success"; // 返回上游成功
    public static final String RESPONSE_RESULT_FAIL = "fail";
    public static final String RETURN_VALUE_SUCCESS = "2";
    HaitianConfig(String payParam ){

        Assert.notNull(payParam, "init sft config error");
        JSONObject object = JSON.parseObject(payParam);
        setAppId(object.getString("appId"));
        setPrivateKey(object.getString("privatekey"));
        setRequestUrl(object.getString("requestUrl"));

    }
}
